home *** CD-ROM | disk | FTP | other *** search
- *** bezerk.c.old Fri Dec 4 16:22:20 1992
- --- bezerk.c Fri Dec 4 22:51:12 1992
- ***************
- *** 1281,1290 ****
- if (e) j = (e - s) - 1; /* calculate message length */
- else j = strlen (s) - 1;/* otherwise is remainder of data */
- if (m) { /* new cache needed, have previous data? */
- ! n->header = (char *) fs_get (sizeof (FILECACHE) + j);
- n = (FILECACHE *) n->header;
- }
- ! else m = n = (FILECACHE *) fs_get (sizeof (FILECACHE) + j);
- /* copy message data */
- strncpy (n->internal,s,j);
- n->internal[j] = '\0';
- --- 1281,1290 ----
- if (e) j = (e - s) - 1; /* calculate message length */
- else j = strlen (s) - 1;/* otherwise is remainder of data */
- if (m) { /* new cache needed, have previous data? */
- ! n->header = (char *) fs_get (sizeof (FILECACHE) + j + 1);
- n = (FILECACHE *) n->header;
- }
- ! else m = n = (FILECACHE *) fs_get (sizeof (FILECACHE) + j + 1);
- /* copy message data */
- strncpy (n->internal,s,j);
- n->internal[j] = '\0';
- ***************
- *** 1328,1334 ****
- for (i = stream->nmsgs, n = m; i < nmsgs; i++) {
- LOCAL->msgs[i] = m = n; /* set cache, and next cache pointer */
- n = (FILECACHE *) n->header;
- ! if (!((s = m->internal) && VALID)) fatal ("Bogus entry in new cache list");
- m->header = s = ++t; /* pointer to message header */
- m->headersize -= m->header - m->internal;
- m->body = NIL; /* assume no body as yet */
- --- 1328,1340 ----
- for (i = stream->nmsgs, n = m; i < nmsgs; i++) {
- LOCAL->msgs[i] = m = n; /* set cache, and next cache pointer */
- n = (FILECACHE *) n->header;
- ! /* This is a bugtrap for bogons in the new message cache, which may happen
- ! * if memory is corrupted. Note that in the case of a totally empty
- ! * message, a newline is appended and counts adjusted.
- ! */
- ! if ((!((s = m->internal) && VALID)) &&
- ! !(s && !strchr (s,'\n') && strcat (s,"\n") && VALID &&
- ! m->headersize++)) fatal ("Bogus entry in new cache list");
- m->header = s = ++t; /* pointer to message header */
- m->headersize -= m->header - m->internal;
- m->body = NIL; /* assume no body as yet */
-